﻿using System;
using System.Data;
public partial class _Default : System.Web.UI.Page 
{
    Data data = new Data();
    protected void Page_Load(object sender, EventArgs e)
    {
        string chuyenmuc1 = "<h2 style='font-weight:bold;padding-left:20px'>aa</h2>";
        DataTable table = data.GetTable_DoanhNghiep();

        for (int i = 0; i < table.Rows.Count; i++)
        {
            chuyenmuc1 += "<a style='padding-right:100px;font-size:15px;padding-left:30px;color:black' href='Index.aspx?name=" + table.Rows[i]["DoanhNghiepName"].ToString() + "'>- "
                + table.Rows[i]["DoanhNghiepDescription"].ToString() + "</a><br/><br/><br/>";
        }
        for (int i = 0; i < 3; i++)
        {
            chuyenmuc1 += "<br/>";
        }
        Literal1.Text = chuyenmuc1;

        
        string tableName = Request.QueryString["name"];
        string tableNameDetail = data.GetTable_DoanhNghiep_Name(tableName);
        table.Clear();
        table = data.GetTable_By_Name(tableName);
        string chitiet = "<h2 style='font-weight:bold;padding-left:20px'>" + tableNameDetail + "</h2>";
    
        for (int i = 0; i < table.Rows.Count; i++)
        {
            chitiet += "<a style='padding-right:100px;font-size:15px;padding-left:30px;color:black' href='Detail.aspx?id=" + table.Rows[i]["DoanhNghiepDangKyID"].ToString() + "'>- "
               + table.Rows[i]["DoanhNghiepDangKyTieuDe"].ToString() + "</a><br/><br/><br/>";
        }
            Literal2.Text = chitiet;
    }

}
